import request from '@/utils/request'
export default {
    //加入购物车
    addToCart(dishId){
        return request({
            url:`/ordermealservice/shoppingcart/addToCart/${dishId}`,
            method:'put',
        })
    },
    //减少购物车菜品数量
    subFromCart(dishId){
        return request({
            url:`/ordermealservice/shoppingcart/subFromCart/${dishId}`,
            method:'put',
        })
    },
    // 批量删除购物车
    deleteFromShoppingCart(ids){
        return request({
            url:"/ordermealservice/shoppingcart/deleteFromShoppingCart",
            method:'delete',
            params: {ids:ids}
        })
    },
    // 批量删除购物车(通过id)
    deleteFromShoppingCartById(ids){
        return request({
            url:"/ordermealservice/shoppingcart/deleteFromShoppingCartById",
            method:'delete',
            params: {ids:ids}
        })
    },
    //查看购物车
    queryShoppingCart(){
        return request({
            url:'/ordermealservice/shoppingcart/queryShoppingCart',
            method:'get'
        })
    },
    //查询购物车id
    queryShoppingCartId(dishIds){
        return request({
            url:"/ordermealservice/shoppingcart/queryShoppingCartId",
            method:"get",
            params:{dishIds:dishIds}
        })
    }
}